votes = {"Jimmy": 0, "Cookie": 0, "Ricky": 0}
rounds = 0
while rounds < 5:
    name = input("请输入候选人姓名：")
    if name == "Jimmy":
        votes["Jimmy"] += 1
    elif name == "Cookie":
        votes["Cookie"] += 1
    elif name == "Ricky":
        votes["Ricky"] += 1
    rounds += 1
print("竞选结果：", end="")
for key, value in votes.items():
    print("{}获得{}票；".format(key, value), end="")
    if value == max(votes.values()):
        winner = key
print("{}成功当选班长。".format(winner))
